home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / desaxe / saxio.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-04-04  |  1.3 KB  |  53 lines

  1. /*
  2.  *  saxio.h
  3.  *  
  4.  *
  5.  *  Created by Andreas Vox on 21.09.06.
  6.  *  Copyright 2006 under GPL2. All rights reserved.
  7.  *
  8.  */
  9.  
  10.  
  11.  
  12. #ifndef SAXIO_H
  13. #define SAXIO_H
  14.  
  15. #include "desaxe_conf.h"
  16. #include "saxhandler.h"
  17. //#include "digester.h"
  18.  
  19. namespace desaxe {
  20. class Digester;
  21. }
  22.  
  23. /** Interface class for any object which wants to use deSaXe to load from 
  24.     and save to XML.
  25.  */
  26. class SaxIO {
  27. public:
  28.     /**
  29.         Writes an XML representation of this object
  30.      */
  31.     virtual void saxx(SaxHandler &, const Xml_string& /* elemtag */) const = 0;
  32.     /**
  33.         Writes an XML representation of this object using the default element tag, see below
  34.      */
  35.     virtual void saxx(SaxHandler & ) const = 0;
  36.     virtual ~SaxIO() {}
  37.     /**
  38.         Element tag which is usually used to serialize this object. "" means no elem is created by saxx()
  39.      */
  40.     static const Xml_string saxxDefaultElem;
  41.     /**
  42.       Fills the digester with rules wich ensure that an object which was
  43.       saved via saxx() will be reconstructed on top of the digester stack.
  44.       The prefix pattern shall be used to create patterns which constrain
  45.       the added rules to this context.
  46.       Unfortunately there are no virtual static functions, so this is just a dummy
  47.       serving as a template.
  48.      */
  49.     static void desaxeRules(const Xml_string& /* prefixPattern */, desaxe::Digester & /* ruleset */, const Xml_string /* elemtag */ = saxxDefaultElem) {}
  50. };
  51.  
  52. #endif
  53.